package com.sgb.kjwl.view.ui.adapter.business;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.ApplyEntity;
import com.sgb.kjwl.model.entity.business.MemberEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class MemberListAdapter extends BaseRecycleAdapter<MemberEntity> {

    private TextView tvTitle;
    public MemberListAdapter(Context context, List<MemberEntity> datas) {
        super(context, R.layout.item_member, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final MemberEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        tvTitle = holder.getItem().findViewById(R.id.tv_title);
        TextView tvBlank = holder.getItem().findViewById(R.id.tv_blank);
        if (holder.getPosition() == getDatas().size()){
            tvBlank.setVisibility(View.VISIBLE);
        }else {
            tvBlank.setVisibility(View.GONE);
        }
    }

    private MemberListAdapter.onEditClickListener editClickListener;

    public void setonEditClick(MemberListAdapter.onEditClickListener editClickListener) {
        this.editClickListener = editClickListener;
    }

    public interface onEditClickListener {
        void onDetailedListClick(MemberEntity entity, int position);

        void onInviteOfferClick(MemberEntity entity, int position);
    }
}
